import request from '@/utils/request'

// 查询评论列表
export function listComment(query) {
  return request({
    url: '/model/comment/list',
    method: 'get',
    params: query
  })
}

// 查询评论详细
export function getComment(id) {
  return request({
    url: '/model/comment/' + id,
    method: 'get'
  })
}

// 新增评论
export function addComment(data) {
  return request({
    url: '/model/comment',
    method: 'post',
    data: data
  })
}

// 修改评论
export function updateComment(data) {
  return request({
    url: '/model/comment',
    method: 'put',
    data: data
  })
}

// 删除评论
export function delComment(id) {
  return request({
    url: '/model/comment/' + id,
    method: 'delete'
  })
}

export function examineComment(data) {
  return request({
    url: '/model/comment/examine',
    method: 'put',
    data: data
  })
}

// 通过模型ID查询评论列表
export function getModelCommentList(query = {}) {
  return request({
    url: '/model/comment/getModelList',
    method: 'get',
    params: query
  })
}

// 通过文章ID查询评论列表
export function getColumnCommentList(query = {}) {
  return request({
    url: '/model/comment/getColumnList',
    method: 'get',
    params: query
  })
}

// 模型评论列表 首页模型详情页使用
export function listCommentForIndex(query){
  return request({
    url: '/model/comment/list/index',
    method: 'get',
    params: query
  })
}
